public class 面向对象_4_方法重载_overlord {


    public void add(int x,float y){
        System.out.println(x+y);
    }
    /**
     *   add 方法 名字相同  但参数  类型/个数 不同 叫方法重载 -overlord
     */
    public  void add(int x,int y){
        System.out.println(x+y);
    }
    public  void add(int x,int y,int z){
        System.out.println(x+y);
    }


    /**
     * 实例 练习
     */
    public  void  ces(int x){
        System.out.println(x*x);
    }
    public  void  ces(int x,int y){
        System.out.println(x*x*y*y);
    }
    public  void  ces(String x){
        System.out.println(x);
    }

    //比大小-------------
    public  void max(int x , int y ){
        if (x>y){
            System.out.println(x);
        }else {
            System.out.println(y);
        }
    }
    public  void max(double x , double y ){
        if (x>y){
            System.out.println("最小值为"+y);
        }else {
            System.out.println("最小值为"+x);
        }
    }

    public  void max(double x , double y ,double z ){
        double i = 0;
        if (x > y){
            if (x>z){
                i = x;
            }else {
                i = z;
            }
        }if (x<y){
            if (y>z){
                i = y;
            }if (y<z){
                i =z;
            }
        }
        System.out.println("最大值为"+i);

    }



    public static void main(String[] args) {
        面向对象_4_方法重载_overlord dx =  new 面向对象_4_方法重载_overlord();
        dx.ces(2);
        dx.ces(2,2);
        dx.ces("结果");
        dx.max(4,8);
        dx.max(4.4,3.8);
        dx.max(8.5,54.4,66.7);
    }
}
